import http from '@/utils/http';

export const templateApi = {
  // 获取模板列表
  getTempList: (params?: Record<string, any>) => {
    return http.get('/template/list', { params });
  },

  // 获取模板详情
  getTempDetail: (id: number | string) => {
    return http.get(`/template/${id}`);
  },

  // 创建新模板
  createTemp: (data: Record<string, any>) => {
    return http.post('/template', data);
  },

  // 更新模板
  updateTemp: (id: number | string, data: Record<string, any>) => {
    return http.put(`/template/${id}`, data);
  },

  // 删除模板
  removeTemp: (id: number | string) => {
    return http.delete(`/template/${id}`);
  },
}




